package com.fdb.efp.esb.service.client.impl;

import javax.annotation.PostConstruct;

import com.fdb.efp.esb.common.client.req.EsbReqAppHeadBean;
import com.fdb.efp.esb.common.constant.ESBClientConstance;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import com.baidu.disconf.client.common.annotations.DisconfItem;

@Component("MSESBBeanCreator")
public class MSESBBeanCreator extends DefaultESBBeanCreator {

	@Value("${esb.client.ms.usrno}")
	private String usrno;
	
	@PostConstruct
	public void test () {
		System.out.println(usrno);
	}

	@DisconfItem(key = "esb.client.ms.usrno", associateField = "usrno")
	public String getUsrno() {
		return usrno;
	}

	public void setUsrno(String usrno) {
		this.usrno = usrno;
	}

	@Override
	protected EsbReqAppHeadBean buildAppHead() {
		EsbReqAppHeadBean appHead = new EsbReqAppHeadBean();
		appHead.setInstId(ESBClientConstance.InstId);
		appHead.setUsrNo(usrno);
		appHead.setCnlTp(ESBClientConstance.CnlTp);

		appHead.setUsrPswd("");
		appHead.setUsrLvl("");
		appHead.setUsrTp("");
		appHead.setTlrSrlNo("");
		appHead.setCnlDtlTp("");
		appHead.setCnsmrTxnCd("");
		return appHead;
	}
}
